<template>
  <div class="top-bar">
    <div class="logo">
      <img src="../assets/images/favicon.svg" class="logo-img">
      <p class="logo-name">CZAH</p>
    </div>
    <div class="menu">
      <ButtonVue :nom="id==0?'cprimary':'csecondary'" @click="changeWall(0)">留言墙</ButtonVue>
      <ButtonVue :nom="id==1?'cprimary':'csecondary'" class="menu-wall" @click="changeWall(1)">照片墙</ButtonVue>
    </div>
    <div class="user">
      <div class="user-head"></div>
    </div>
  </div>
</template>

<script>
import ButtonVue from './Button.vue';
export default {
  data(){
    return{

    }
  },
  components:{
    ButtonVue
  },
  computed:{
    id(){
      return this.$route.query.id;
    }
  },
  methods:{
    changeWall(e){
      this.$router.push({
        query:{id:e},
      })
    }
  }
}
</script>

<style lang="less" scoped>
   .top-bar{
    width: 100%;
    height:42px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:0 30px;
    box-sizing: border-box;
    .logo{
      display: flex;
      align-items: center;
      .logo-name{
        font-size: 20px;
        color: #202020;
        font-weight: 600;
        padding-left:10px;
      }
    }
    .menu{
      padding-left: 100px;
      .menu-wall{
        margin-left: 20px;
      }
    }
    .user{
      width: 200px;
      .user-head{
        float: right;
        border-radius: 50%;
        height: 36px;
        width: 36px;
        background-image: linear-gradient(180deg,#7be7ff 2%,#1e85e2);
        cursor: pointer;
      }
    }
   }
</style>